<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<script type="text/javascript">
	const arr=[2,6,1,7,4,88,99,100,0]
	let max=arr[0]
	let min=arr[0]
	for (let i = 1; i < arr.length; i++) {
		if (arr[i]>max) {
			// 最大值
			max=arr[i]
		}if (arr[i]<min) {
			// 最小值
			min=arr[i]
		}
	}
	console.log(max,min)

</script>
</body>
</html>